<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <route-view style="height:100%"></route-view>
  </div>
</template>

<script>
import RouteView from '@/components/layouts/RouteView'
import { mixinDevice } from '@/utils/mixin.js'
import { getAction, postAction } from '@/api/manage'
import { setToken } from '@/utils/auth'
import Account from '@/views/user/createAccount'

export default {
  name: 'UserLayout',
  components: { RouteView, Account },
  mixins: [mixinDevice],
  data () {
    return {

      redirect: undefined,

    }
  },
  watch: {
    $route: {
      handler: function (route) {
        this.redirect = route.query && route.query.redirect
      },
      immediate: true,
    },
  },
  created () {

  },
  mounted () {
    // 监听接收消息
    const that = this
    this.$EventBus.$on('ISLOGIN', function (res) {
      that.isLogin = false
    })
    document.body.classList.add('userLayout')
  },
  beforeDestroy () {
    this.$EventBus.$off('ISLOGIN')
    document.body.classList.remove('userLayout')
  },
  methods: {
  },
}
</script>

<style lang="scss">
$bg: #006FFF;
$dark_gray: #889aa4;
$light_gray: #eee;
$cursor: #fff;

#userLayout.user-layout-wrapper {
  height: 100%;

  &.mobile {
    .container {
      .main {
        max-width: 368px;
        width: 98%;
      }
    }
  }

  @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
    .container .el-input input {
      color: $cursor;
    }
  }

  .container {
    // background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
    // background-size: 100%;
    // padding: 110px 0 144px;
    // position: relative;
    min-height: 100%;
    width: 100%;
    background-color: $bg;
    overflow: hidden;
    background: url('~@/assets/login/login_bg.png') no-repeat;
    background-size: 100% 100%;

    .el-input {
      display: inline-block;
      height: 0.881305rem;
      width: 85%;

      .el-input__icon {
        height: 40px; // 设置高度，icon元素恢复原来的高度，这时arror才能垂直居中
        position: relative;
        top: 5px; // 元素整体上移，需要自己调整，让箭头也居中
      }

      input {
        background: transparent;
        border: 0px;
        -webkit-appearance: none;
        border-radius: 0px;
        padding: 12px 5px 12px 15px;
        color: $light_gray;
        height: 47px;
        caret-color: $cursor;
        text-align: center;

        &:-webkit-autofill {
          box-shadow: 0 0 0px 1000px $bg inset !important;
          -webkit-text-fill-color: $cursor !important;
        }
      }
    }

    .el-form-item {
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(0, 0, 0, 0.1);
      border-radius: 5px;
      color: #454545;
    }

    .login-form {
      position: relative;
      width: 7.294206rem;
      // height: 8.888056rem;
      max-width: 100%;
      margin-top: 1.631352rem;
      margin-right: 1.875117rem;
      overflow: hidden;
      // background: #ffffff;
      opacity: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0.56rem;
      // padding-left: 0.562535rem;
      // padding-right: 0.562535rem;
      .login-title {
        font-size: 0.375023rem;
        font-family: PingFang SC;
        font-weight: bold;
        line-height: 0.525033rem;
        // color: #1890fc;
        opacity: 1;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 0.63754rem;
      }
      .userinput {
        width: 6.169136rem;
        height: 0.937559rem;
        background: #ffffff;
        border: 1px solid #dddddd;
        opacity: 1;
        border-radius: 0.093756rem;
        margin-top: 0.468779rem;
        color: #666666;
        padding-left: 0.375023rem;
        font-size: 0.262516rem;
      }
      .codeinput {
        margin-top: 0.431277rem;
        width: 3.806488rem;
      }
      .pwdinput {
        margin-top: 0.393775rem;
      }
      .btn-sendmsg {
        margin-left: 0.262516rem;
        width: 2.100131rem;
        height: 0.937559rem;
        background: #1890fc;
        opacity: 1;
        border-radius: 0.093756rem;
        font-size: 0.262516rem;
        font-family: PingFang SC;
        font-weight: 400;
        color: #ffffff;
        opacity: 1;
      }
      .agreement-view {
        margin-top: 0.375023rem;
        align-items: center;
        display: flex;
        .readtext {
          font-size: 0.225014rem;
          font-family: PingFang SC;
          font-weight: 400;
          color: #666666;
          opacity: 1;
        }
        .agreement {
          font-size: 0.225014rem;
          font-family: PingFang SC;
          font-weight: 400;
          color: #999999;
          opacity: 1;
        }
      }
      .go-login-tip {
        margin-top: 0.375023rem;
        align-items: center;
        display: flex;
        justify-content: center;
        .has-account {
          font-size: 0.262516rem;
          font-family: PingFang SC;
          font-weight: 400;
          color: #707070;
          opacity: 1;
        }
        .go-login {
          font-size: 0.262516rem;
          font-family: PingFang SC;
          font-weight: 400;
          color: #1890fc;
          opacity: 1;
          margin-left: 0.093756rem;
        }
      }
    }

    .tips {
      font-size: 14px;
      color: #fff;
      margin-bottom: 10px;

      span {
        &:first-of-type {
          margin-right: 16px;
        }
      }
    }

    .svg-container {
      position: absolute;
      // padding: 6px 5px 6px 15px;
      padding-left: 0.26rem;
      color: $dark_gray;
      vertical-align: middle;
      height: 0.3rem;
      // display: inline-block;
      top: 0.8rem;
    }

    .password {
      padding-left: 0.265rem;
      height: 0.29rem;
      top: 0.73rem;
    }

    .show-pwd {
      position: absolute;
      right: 10px;
      top: 7px;
      font-size: 16px;
      color: $dark_gray;
      cursor: pointer;
      user-select: none;
    }
  }
  .login-view {
    width: 80%;
    min-width: 910px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .title-container {
    position: relative;
    // margin-top: 1.743859rem;
    margin-left: 2.193887rem;
    flex: 1;

    .title {
      font-size: 80px;
      font-family: PingFang SC;
      font-weight: 600;
      line-height: 120px;
      color: #ffffff;
      opacity: 1;
    }
    .title-en {
      font-size: 0.8rem;
      line-height: 1rem;
    }
    img {
      width: 1.143821rem;
      height: 1.068817rem;
      margin-left: 0.375023rem;
    }
    .bottom-title {
      display: flex;
      align-items: center;
      img {
        width: 2.700169rem;
        height: 0.48753rem;
        margin-left: 0;
      }
      .project-name {
        font-size: 0.56rem;
        font-family: PingFang SC;
        font-weight: 500;
        line-height: 0.787549rem;
        color: #ffffff;
        opacity: 1;
        margin-left: 0.093756rem;
      }
      .project-name-en {
        font-size: 0.4rem;
      }
    }

    .inputStyle {
      width: 1.875117rem;
    }
    ::v-deep .el-form-item {
      border: none;
      background: none;
      border-radius: 0;
      margin-bottom: 0;
      // color: #454545;
    }
  }
}
</style>